/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Model;

import java.io.IOException;
import java.net.URL;
import java.util.Properties;

/**
 *
 * @author pyty
 */
public class Test {
    public static void main (String args[]) {
        Properties props = new Properties();

        URL url = ClassLoader.getSystemResource("dbconfig.properties");
        //ClassLoader.getSystemResource(null)
        try {
            props.load(url.openStream());
            
        } catch (IOException ex) {
            //throw new RuntimeException("Error opening DB config file", ex);
            System.err.println("CHYBA");
        }
        
        System.out.println("DB name: " + props.getProperty("dbname"));
        System.out.println("DB user: " + props.getProperty("dbuser"));
        System.out.println("DB pass: " + props.getProperty("dbpass"));
        System.out.println("");
        
        DBConfig dbc = new DBConfig();
        
        System.out.println("DB url: " + dbc.getDbUrl());
        System.out.println("DB user: " + dbc.getDbUser());
        System.out.println("DB pass: " + dbc.getDbPass());
        System.out.println("DB driver: " + dbc.getDbDriver());
    }
}
